package com.muyu.vehicle.domain.es;

import com.vehicle.common.core.annotation.Excel;
import lombok.Data;
import org.springframework.data.annotation.Id;
import org.springframework.data.elasticsearch.annotations.Document;
import org.springframework.data.elasticsearch.annotations.Field;
import org.springframework.data.elasticsearch.annotations.FieldType;

import java.io.Serializable;

/**
 * @Author: ♥
 * @Date: 2025/3/31 18:40
 * @Description:
 **/
@Data
@Document(indexName = "vehicle_info",replicas = 1,shards = 1)
public class InfoEs implements Serializable {

    /** ID */
    @Id
    @Field(type = FieldType.Keyword)
    private String id;

    /** 车辆编号 */
    @Excel(name = "车辆编号")
    @Field(type = FieldType.Keyword,analyzer = "ik_max_word")
    private String vehicleCode;

    /** 车辆VIN */
    @Excel(name = "车辆VIN")
    @Field(type = FieldType.Keyword,analyzer = "ik_max_word")
    private String vehicleVin;

    /** 车辆类型 */
    @Excel(name = "车辆类型")
    @Field(type = FieldType.Keyword,analyzer = "ik_max_word")
    private String vehicleType;

    /** 车辆绑定电子围栏 */
    @Excel(name = "车辆绑定电子围栏")
    private String vehicleFence;

    /** 车辆状态 */
    @Excel(name = "车辆状态")
    private Integer vehicleStatus;

    /** 电机厂商 */
    @Excel(name = "电机厂商")
    private String vehicleMotor;

    /** 电池厂商 */
    @Excel(name = "电池厂商")
    private String vehicleBattery;

    /** 电机编号 */
    @Excel(name = "电机编号")
    private String vehicleMotorCode;

    /** 电池编号 */
    @Excel(name = "电池编号")
    private String vehicleBatteryCode;

    
    @Field(type = FieldType.Text, 
           analyzer = "ik_smart",  // 使用智能分词
           searchAnalyzer = "ik_smart",
           fielddata = true)
    private String vehicleModel; // 车辆型号字段加强分词配置

    // 新增自定义分词器配置（需要与ES中的配置对应）
    @Field(type = FieldType.Text, 
           analyzer = "my_custom_analyzer",
           searchAnalyzer = "my_custom_analyzer")
    private String specialFeature; // 假设的特殊特征字段
}
